package com.hoshiicloud.payment.feign.fallback;

import com.hoshiicloud.payment.feign.DownloadService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @program: hoshiicloud
 * @description: 文件服务熔断
 * @author: Mr.wu
 * @create: 2019-06-04 10:59
 **/
@Component
@Slf4j
public class DownloadServiceFeignFallbackFactory implements FallbackFactory<DownloadService> {

    @Override
    public DownloadService create(Throwable throwable) {
        log.error("fallback; reason was:" + throwable.toString());
        return (bucketName, objectKey) -> null;
    }
}
